-
Notifications
You must be signed in to change notification settings - Fork 360
fix(Select): fix checkAll option in group mode #3941
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
commit: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes the "select all" functionality in grouped Select components. When using option groups with a "checkAll" option, the component now correctly includes options from groups in the calculation of selectable items.
Key Changes
- Modified the
onCheckAllChangefunction inSelect.tsxto handle nested options within option groups - Fixed the initial state calculation for the "checkAll" checkbox in
Option.tsx - Added optional chaining for safe access to options array in the
onRemovehandler - Added a test case to verify the grouped select "checkAll" functionality
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/components/select/base/Select.tsx | Updated onCheckAllChange to iterate through grouped options and added safe navigation for options lookup |
| packages/components/select/base/Option.tsx | Fixed initial checkbox state calculation to use optionLength comparison |
| packages/components/select/tests/select.test.tsx | Added test case for grouped select with "checkAll" functionality |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>

🤔 这个 PR 的性质是?
🔗 相关 Issue
💡 需求背景和解决方案
📝 更新日志
fix(Select): 修复
1.15.7版本中全选功能在分组模式下功能异常的问题本条 PR 不需要纳入 Changelog
☑️ 请求合并前的自查清单